package demo.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order  //数字越大，优先级越低
@Slf4j
@Component
//@Aspect
public class AspectDemo2 {

//    @Before("execution(* demo.controller.*.*(..))")
//    public void doBefore(){
//        log.info("AspectDemo2 do before...");
//    }

    @Before("demo.aspect.cutPoint()")
    public void doBefore(){
        log.info("AspectDemo2 do before...");
    }

    @After("execution(* demo.controller.*.*(..))")
    public void doAfter(){
        log.info("AspectDemo2 do after...");
    }
}
